﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FXFinanceLeaseUpdate.aspx.cs" Inherits="IHISCETeim.Web.MachineSys.FXModel.FXFinanceLeaseUpdate" %>

<h2 class="contentTitle"  style=" margin-bottom:1px!important;">
    编辑融资租赁进度信息
</h2>
<div class="pageContent">
	
	<form method="post" action="FXModel/FXFinanceLeaseUpdate.aspx?ajaxmethod=edit&FnncLsId=<%=FnncLsId %>&NextLeaseStatus=<%=NextLeaseStatus %>" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone)">
		<div class="pageFormContent" layoutH="92" style=" padding-top:1px!important;">			
          
          
            <div class="panel collapse" >
		         <h1 style="color:Red;">
                    进度及状态快速跟进：
                 </h1>
                 <div>
                 <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td width="50%" valign="top" style=" border-right:1px solid #ccc;">
                     <div class="unit">
				          <label>当前进度：</label>
                          <input type="hidden" name="LeaseStatus" value="<%=objFx.LeaseStatus %>" />
				          <input type="text" readonly size="8" value="<%=GetLeaseStatusText(objFx.LeaseStatus)%>"/>
			         </div>
                     <%if (objFx.LeaseStatus !=4 )
                       {%>
                     <div class="unit">
				          <label>是否<%=GetLeaseStatusText(objFx.LeaseStatus + 1)%>：</label>
				          <input type="checkbox" id="FXFinanceLeaseUpdate_goToNextStatus" name="goToNextStatus" value="true" />
			         </div>
                      <%if (objFx.LeaseStatus ==0)
                       {%>
                         <div class="unit shownextleasestatus">
				            <label>收齐资料日期：</label>
				            <input type="text" name="OGetDate"   class=" date" value="" />
			            </div>
                        <div class="unit shownextleasestatus">
				            <label>提交资料日期：</label>
				            <input type="text" name="OSubmitDate"   class=" date" value="" />
			            </div>
                        <%} %>
                     <%} %>
                     <%if (objFx.LeaseStatus == 1)
                       {%>
                     <div class="unit shownextleasestatus">
				          <label><%=GetLeaseStatusText(objFx.LeaseStatus + 1)%>日期：</label>
				          <input type="text"  name="PassDate"   class="date required"/>
			         </div>                     
                     <%} %>

                     <%if (objFx.LeaseStatus == 2)
                       {%>
                     <div class="unit shownextleasestatus">
				          <label>放款日期：</label>
				          <input type="text"  name="LoansDate"   class="date required"/>
			         </div> 
                     <div class="unit shownextleasestatus">
				          <label>合同号：</label>
				          <input type="text"  name="ContractNum"  class="required"/>
			         </div>                    
                     <%} %>  
                     
                      </td>
                      <td width="50%" valign="top">
                      <div>
                       <div class="unit">
				        <label>应付首付款支付状态：</label>
				        <select name="LPayStatus" class="combox"><option value="0" <%=objFx.LPayStatus==0?"selected":"" %>>未付</option><option value="1" <%=objFx.LPayStatus==1?"selected":"" %>>已付</option><option value="2" <%=objFx.LPayStatus==2?"selected":"" %>>无需支付</option></select>
			        </div>
                    <div class="unit">
				        <label>管理费支付状态：</label>
				        <select name="LMFeeStatus" class="combox"><option value="0" <%=objFx.LMFeeStatus==0?"selected":"" %>>未付</option><option value="1" <%=objFx.LMFeeStatus==1?"selected":"" %>>已付</option></select>
			        </div> 
                    <div class="unit">
				        <label>首付/置换分期申请：</label>
				        <input type="text" name="LByStages" value="<%=objFx.LByStages %>"  id="FXFinanceLeaseAdd_LByStages"  class="inputFloat required"  />
			        </div>
                    <div class="unit">
				        <label>合同邮寄情况：</label>
				        <input type="text" name="OContractPost"   class="" value="<%=objFx.OContractPost %>"  />
			        </div>
                    <div class="unit">
				        <label>投保情况：</label>
				        <select name="OInsureStatus" class="combox"><option value="0" <%=objFx.OInsureStatus==0?"selected":"" %>>未投保</option><option value="1" <%=objFx.OInsureStatus==1?"selected":"" %>>已投保</option></select>
			        </div>
                    <div class="unit">
				          <label>资料/协议收集是否完成：</label>
                          <select name="MaterialStatus" class="combox"><option value="0"   <%=objFx.MaterialStatus==0?"selected":"" %>>未完成</option><option value="1" <%=objFx.MaterialStatus==1?"selected":"" %>>已完成</option><option value="2" <%=objFx.MaterialStatus==2?"selected":"" %>>只承诺函</option><option value="3" <%=objFx.MaterialStatus==3?"selected":"" %>>缺承诺函</option></select>
				          
			        </div> 
                    <div class="unit">
				        <label>GPS状态：</label>
				        <select name="GPSStatus" class="combox"><option value="0" <%=objFx.GPSStatus==0?"selected":"" %>>服务中</option><option value="1" <%=objFx.GPSStatus==1?"selected":"" %>>停止服务</option></select>
			        </div>
                    <div class="unit">
				        <label>结清状态：</label>
				        <input type="text" readonly value="<%= objFx.CleanUpStatus==-1?"未清":objFx.CleanUpStatus==0?"已到期未结清":"1已结清" %>" />
			        </div>
                </div> 
                     </td>
                    </tr>
                  </table>             
                </div>
            </div>
               
                    
               
          



            <div style="clear:both;"></div>
           
			<div class="panel collapse" >
		        <h1>机器及客户信息</h1>
		        <div>
                    <div class="unit">
				        <label>经销商：</label>
				        <input type="text" name="AliasName"  value="<%=objFx.AliasName %>"  class="required autocomplete" autocompletehref="<%=AutoCompleteRequestUrl %>?ajaxmethod=getagentlist" mustMatch="true" swidth="300" showinputid=""/>
			        </div>
			        <div class="unit">
				        <label>用户：</label>
				        <input type="text"  name="CustomerName"  value="<%=objFx.CustomerName %>" class="required"/>
			        </div>
                     <div class="unit">
				        <label>联系电话：</label>
				        <input type="text"  name="CustomerMobile"   value="<%=objFx.CustomerMobile %>" class="phone"/>
			        </div>
                    <div class="unit">
				        <label>地址：</label>
				        <input type="text"  name="CustomerAddress" value="<%=objFx.CustomerAddress %>"  class=""/>
			        </div>
			        <div class="unit">
				        <label>机型：</label>
                        <%=GetMacType("select", "MachineType", objFx.MachineType)%>
			        </div>
                    <div class="unit">
				        <label>机号：</label>
				        <input type="text"  name="SerialNumber"  value="<%=objFx.SerialNumber %>" class="required"/>
			        </div>
                    <div class="unit">
				        <label>GPS号：</label>
				        <input type="text"  name="GPSNumber"  value="<%=objFx.GPSNumber %>"  class=""/>
			        </div>
                   
                </div>
	        </div>	
	        <div style="clear:both;"></div>
            <div class="panel collapse" >
		        <h1>融资租赁信息</h1>
		        <div>
                    <div class="unit">
				        <label>接单日期：</label>
				        <input type="text" name="LOrderDate" value="<%=GetDateShowType(objFx.LOrderDate) %>"   class="date" />
			        </div>
                    <div class="unit">
				        <label>租赁公司：</label>
				        <%=GetLeaseCompany("LeaseCompany", objFx.LeaseCompany, "required")%>
			        </div>
                    <div class="unit">
				        <label>售价：</label>
				        <input type="text" name="LTotalPrice" id="FXFinanceLeaseAdd_LTotalPrice" value="<%=objFx.LTotalPrice %>" class="inputFloat required FXFinanceLeaseAdd_ChangeMoney" />
			        </div>
                    <div class="unit">
				        <label>首付比例：</label>
				        <input type="text" name="LowProportion" id="FXFinanceLeaseAdd_LowProportion"  value="<%=objFx.LowProportion %>" class="inputFloat required FXFinanceLeaseAdd_ChangeMoney" />
                        <span>%</span>
			        </div>
                     <div class="unit">
				        <label>首付金额：</label>
				        <input type="text" name="LDownAmount" readonly id="FXFinanceLeaseAdd_LDownAmount"  value="<%=objFx.LDownAmount %>"  class="inputFloat" />
			           
                    </div>
                     <div class="unit">
				        <label>融资额：</label>
				        <input type="text" name="LAmountFinancing" readonly  id="FXFinanceLeaseAdd_LAmountFinancing" value="<%=objFx.LAmountFinancing %>" class="inputFloat" />
			        </div>
                    <div class="unit">
				        <label>期限：</label>
				        <input type="text" name="LExpiresYear"   id="FXFinanceLeaseAdd_LExpiresYear"  value="<%=objFx.LExpiresYear %>"  class="inputFloat required" />
                        <span>(年)</span>
			        </div>
                    <div class="unit" > 
				        <label style=" text-align:right!important;">期数1：</label>
				        <input type="text" name="LExpiresMonth" id="FXFinanceLeaseAdd_LExpiresMonth"  value="<%=objFx.LExpiresMonth %>"  class="inputInteger required" />
                        <span>(月)正常的还款期数</span>
			        </div>
                    <div class="unit">
				        <label style=" text-align:right!important;">月租金1：</label>
				        <input type="text" name="LMonthRent"  id="FXFinanceLeaseAdd_LMonthRent" value="<%=objFx.LMonthRent %>"  class="inputFloat required" />
                        <span>对应于期数1</span>
			        </div>
                    <div class="unit">
				        <label style=" text-align:right!important;">期数2：</label>
				        <input type="text" name="LExpiresMonth2" id="FXFinanceLeaseAdd_LExpiresMonth2" value="<%=objFx.LExpiresMonth2 %>"  class="inputInteger required" />
                        <span>(月)如冬季及雨季政策</span>
			        </div>
                    <div class="unit">
				        <label style=" text-align:right!important;">月租金2：</label>
				        <input type="text" name="LMonthRent2" value="<%=objFx.LMonthRent2 %>"   class="inputFloat required" />
                        <span>对应于期数2</span>
			        </div>
                    <div class="unit">
				        <label>合同金额：</label>
				        <input type="text" name="LContractAmount" value="<%=objFx.LContractAmount %>"  id="FXFinanceLeaseAdd_LContractAmount" class="inputFloat required FXFinanceLeaseAdd_ChangeMoney"  />
			        </div>
                    
                    <div class="unit">
				        <label>应付首付款：</label>
				        <input type="text" name="LPay"  id="FXFinanceLeaseAdd_LPay"  value="<%=objFx.LPay %>" class="inputFloat" />
                        
			        </div>
                    <div class="unit">
                        <label>已付首付款：</label>
				        <input type="text" name="LPayYiFu"  id="FXFinanceLeaseAdd_LPayYiFu"  value="<%=objFx.LPayYiFu %>" class="inputFloat" />
                        
				         <label>首付支付日期：</label>
				        <input type="text" name="LDownAmountDate"  class="date" value="<%=objFx.LDownAmountDate %>"/>
			        </div>

                    <div class="unit">
				        <label>管理费：</label>
				        <input type="text" name="LMFee"  id="FXFinanceLeaseAdd_LMFee" class="required inputFloat" value="<%=objFx.LMFee %>"/>
                       
			        </div>
                    <div class="unit">
                        <label>已付管理费：</label>
				        <input type="text" name="LMFeeYiFu"  id="FXFinanceLeaseAdd_LMFeeYiFu"  value="<%=objFx.LMFeeYiFu %>" class="inputFloat" />
                        
				         <label>管理费支付日期：</label>
				        <input type="text" name="LMFeeDate"  class="date" value="<%=objFx.LMFeeDate %>"/>
			        </div>
                     

                     <%if (objFx.LeaseStatus != 1)
                       {%>
                    <div class="unit">
				          <label>审核通过日期：</label>
				          <input type="text"  name="PassDate"   class="date" value="<%=GetDateShowType(objFx.PassDate) %>"/>
			        </div>                   
                   
                   
                    <%} %>
                     <%if (objFx.LeaseStatus != 2)
                       {%>
                    <div class="unit">
				          <label>放款日期：</label>
				          <input type="text"  name="LoansDate"   class="date" value="<%=GetDateShowType(objFx.LoansDate) %>"/>
			        </div>
                     <div class="unit">
				          <label>合同号：</label>
				          <input type="text"  name="ContractNum"   class=""  value="<%=objFx.ContractNum %>"/>
			        </div>
                    <%} %>
                                   
                    <div class="unit">
				          <label>总应付租金：</label>
				          <input type="text" readonly  value="<%=objFx.LEvadeRent %>"  />
			        </div>
                     <div class="unit">
				          <label>累计已付租金：</label>
				          <input type="text" readonly  value="<%=objFx.LPaidRent  %>"  />
			        </div>
                    <div class="unit">
				          <label>剩余租金：</label>
				          <input type="text" readonly  value="<%=objFx.LResiduerRent  %>"  />
			        </div>
                    <div class="unit">
				          <label>总期数：</label>
				          <input type="text" readonly  value="<%=objFx.LTotalPeriods  %>"  />
			        </div>
                    <div class="unit">
				          <label>应付期数：</label>
				          <input type="text" readonly  value="<%=objFx.LEvadePeriods  %>"  />
			        </div>
                    <div class="unit">
				          <label>已付期数：</label>
				          <input type="text" readonly  value="<%=objFx.LPaidPeriods  %>"  />
			        </div>
                     <div class="unit">
				          <label>逾期期数：</label>
				          <input type="text" readonly  value="<%=objFx.LExpiryPeriods  %>"  />
			        </div>
                    <div class="unit">
				          <label>最后支付日期：</label>
				          <input type="text" readonly  value="<%=GetDateShowType(objFx.LastPayDate)  %>"  />
			        </div>
                </div>
	        </div>	
	        <div style="clear:both;"></div>
            <div class="panel collapse" >
		        <h1>其它信息</h1>
		        <div>
                 <%if (objFx.LeaseStatus !=0)
                   {%>
                     <div class="unit">
				        <label>收齐资料日期：</label>
				        <input type="text" name="OGetDate"   class=" date" value="<%=GetDateShowType(objFx.OGetDate) %>" />
			        </div>
                    <div class="unit">
				        <label>提交资料日期：</label>
				        <input type="text" name="OSubmitDate"   class=" date" value="<%=GetDateShowType(objFx.OSubmitDate) %>" />
			        </div>
                    <%} %>
                  
                    <div class="unit">
				        <label>备注说明：</label>
                        <textarea name="ORemark" cols="50" rows="10" ><%=objFx.ORemark %></textarea>
			        </div>
                </div>
	        </div>	
            <input id="FXFinanceLeaseUpdate_isrefreshpar" name="isrefreshpar" type="hidden" value="false" />
	        <div style="clear:both;"></div>
		</div>
		<div class="formBar">
			<ul>
                <li>
                   <label><input type="checkbox" rel="#FXFinanceLeaseUpdate_isrefreshpar" onchange="$($(this).attr('rel')).val($(this).attr('checked')) " />是否刷新列表页</label> 
                </li>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="button" class="close" onclick="FXFinanceLeaseMasterList_Close();">关闭</button></div></div></li>
			</ul>
		</div>
	</form>
	
</div>

<script>
    $(document).ready(function () {
        $("#FXFinanceLeaseUpdate_goToNextStatus").change(function () {
            //alert($(this).attr("checked"));
            if ($(this).attr("checked")) {
                $("div.shownextleasestatus").show().find("input:text").addClass("required");
            } else {
                $("div.shownextleasestatus").hide().find("input:text").removeClass("required");
            }
            
        })
        $("div.shownextleasestatus").hide().find("input:text").removeClass("required");

        //自动计算
        $(".FXFinanceLeaseAdd_ChangeMoney").blur(function () {
            FXFinanceLeaseAdd_ChangeMoney();
        })

        $("#FXFinanceLeaseAdd_LExpiresYear").blur(function () {
            //期限（年）
            var $LExpiresYear = $(this);
            //期数1
            var $LExpiresMonth = $("#FXFinanceLeaseAdd_LExpiresMonth");
            //期数2
            var $LExpiresMonth2 = $("#FXFinanceLeaseAdd_LExpiresMonth2");

            $LExpiresMonth.val($LExpiresYear.val() * 12);
            $LExpiresMonth2.val(0);
            FXFinanceLeaseAdd_ChangeMoney();
        })

        $("#FXFinanceLeaseAdd_LExpiresMonth").blur(function () {
            //期限（年）
            var $LExpiresYear = $("#FXFinanceLeaseAdd_LExpiresYear");
            //期数1
            var $LExpiresMonth = $("#FXFinanceLeaseAdd_LExpiresMonth");
            //期数2
            var $LExpiresMonth2 = $("#FXFinanceLeaseAdd_LExpiresMonth2");


            $LExpiresMonth2.val(parseFloat($LExpiresYear.val()) * 12 - parseFloat($LExpiresMonth.val()))
        })

    })

    function FXFinanceLeaseAdd_ChangeMoney() {
        //售价
        var $LTotalPrice = $("#FXFinanceLeaseAdd_LTotalPrice");
        //首付比例%
        var $LowProportion = $("#FXFinanceLeaseAdd_LowProportion");
        //首付金额
        var $LDownAmount = $("#FXFinanceLeaseAdd_LDownAmount");
        //融资额
        var $LAmountFinancing = $("#FXFinanceLeaseAdd_LAmountFinancing");
        //期限（年）
        var $LExpiresYear = $("#FXFinanceLeaseAdd_LExpiresYear");
        //期数1
        var $LExpiresMonth = $("#FXFinanceLeaseAdd_LExpiresMonth");
        //期数2
        var $LExpiresMonth2 = $("#FXFinanceLeaseAdd_LExpiresMonth2");

        //合同金额
        var $LContractAmount = $("#FXFinanceLeaseAdd_LContractAmount");
        //应付首付款
        var $LPay = $("#FXFinanceLeaseAdd_LPay");
        //管理费
        var $LMFee = $("#FXFinanceLeaseAdd_LMFee");


        $LDownAmount.val($LTotalPrice.val() * $LowProportion.val() / 100);
        $LAmountFinancing.val($LTotalPrice.val() - $LDownAmount.val());
      //  $LPay.val(($LContractAmount.val() - $LAmountFinancing.val()) < 0 ? "0" : ($LContractAmount.val() - $LAmountFinancing.val()));

        var $rate = 0;//  $LExpiresYear.val() == 1 ? 1.6 : $LExpiresYear.val() == 2 ? 2.6 : 3.6;
       // var $rate = $LExpiresYear.val() == 2 ? 2.6 : 3.6;
        switch (parseFloat($LExpiresYear.val())) {
            case 1:
                $rate = 1.6;
                break;
            case 1.5:
                $rate = 2.0;
                break;
            case 2:
                $rate = 2.6;
                break;
            case 2.5:
                $rate = 3.2;
                break;
            case 3:
                $rate = 3.6;
                break;
            default:
                $rate = 3.6;
                break;

        }

        //$LMFee.val($LTotalPrice.val() * $rate / 100);
        //期数处理

        if ((parseFloat($LExpiresMonth.val()) + parseFloat($LExpiresMonth2.val())) != parseFloat($LExpiresYear.val()) * 12)
            alert("期数之和不对，请确认");
    }
</script>